/**
 * Copyright &copy; 2017-2020 <a href="http://www.fosung.com/">FosungFrame</a> All rights reserved.
 */
package com.fosung.frame.modules.partysinfo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fosung.frame.common.persistence.Page;
import com.fosung.frame.common.service.CrudService;
import com.fosung.frame.modules.partysinfo.dao.PartysInfoDao;
import com.fosung.frame.modules.partysinfo.entity.PartysInfo;

/**
 * 组织类型信息设置Service
 * 
 * @author wu
 * @version 2017-09-07
 */
@Service
@Transactional(readOnly = true)
public class PartysInfoService extends CrudService<PartysInfoDao, PartysInfo> {

	@Autowired
	private PartysInfoDao partysInfoDao;

	public PartysInfo get(String id) {
		return super.get(id);
	}

	public PartysInfo getByOrgid(String id) {
		return partysInfoDao.getByOrgid(id);
	}

	public List<PartysInfo> findList(PartysInfo partysInfo) {
		return super.findList(partysInfo);
	}

	public Page<PartysInfo> findPage(Page<PartysInfo> page, PartysInfo partysInfo) {
		return super.findPage(page, partysInfo);
	}

	@Transactional(readOnly = false)
	public void save(PartysInfo partysInfo) {
		super.save(partysInfo);
	}

	@Transactional(readOnly = false)
	public void delete(PartysInfo partysInfo) {
		super.delete(partysInfo);
	}

	public List<PartysInfo> checkByOrganizationId(PartysInfo partysInfo) {
		return dao.checkByOrganizationId(partysInfo);
	}
	
	public List<PartysInfo> getPPartysInfo(PartysInfo partysInfo) {
		return dao.getPPartysInfo(partysInfo);
	}
	
	@Transactional(readOnly = false)
	public void save(List<PartysInfo> lists) {
		if (lists != null&&lists.size()>0) {
			for (int j = 0; j < lists.size(); j++) {
				PartysInfo partysinfo=lists.get(j);
				 super.save(partysinfo);
			}
		}
	}
}